gtkDcoding Blog Post # 26 - Menu Basics

number putimalitze at gmx.de
Sun Apr 14 09:31:41 UTC 2019


On Saturday, 13 April 2019 at 12:42:36 UTC, Ron Tarrant wrote:
> On Saturday, 13 April 2019 at 09:49:47 UTC, number wrote:
>> On Saturday, 13 April 2019 at 00:25:21 UTC, Ron Tarrant wrote:
>> I'm asking because ... the messagebox sized itself to the 
>> shorter text in the content area. They said it's an OS 
>> limitation (meaning gtk standard dialogs).
>
> Because the Dialog class inherits from Window, you can size it 
> with setSizeRequest(). On Windows, at least. I'm not sure about 
> Linux. I'm about to go out for a few hours, so perhaps you 
> could test this.

Yes, this work on Linux, too.

>
>> It also seems dialogs are not user-resizable by default, which 
>> seems strange to me. So I thought to roll my own dialog, but 
>> didn't get to it yet.
>
> That's another topic I have on my list for the dialog series.
>

Sorry, I was unclear. By rolling my own I meant to not use a 
predefined library function MessageRequester() that exists in 
that language, but instead using gtk dialog directly which would 
be more customizable. Anyway that would only be for learning 
purposes, nothing I desperately need.

>> I also wonder why I often encounter gtk apps/windows that are 
>> unresizable, but still have the resize-icon cursor when 
>> hovering the bottom-right window edge, which when used moves 
>> the window instead.
>
> It's because there are two flags controlling resize-ability, 
> both found in generated\gtkd\gdk\c\types.d:
> - a window decorations flag (GdkWMDecoration), and
> - another that controls whether or not the window is allowed to 
> resize (GdkWMFunction).
>
> If the programmer turns off the resize flag, but not the 
> decorator flag, well... there's your answer.
>
> Hope that helps, number.

Ok, I understand. But then it seems still strange that the window 
can be moved by dragging the edge if it's only a decoration that 
is active.

Thanks for your explanations.




More information about the Digitalmars-d-learn mailing list