It is currently Mon Jun 01, 2020 5:33 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Dialog vs. scrollarea
PostPosted: Mon Jan 27, 2020 3:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Sep 20, 2004 7:12 am
Posts: 568
Location: Hell
I get a black background here with no chance to see the texts of the text gadgets.
Tested with Debian Stretch x64
Code:
Procedure.s GetXMLString()
   Protected XML$

   XML$ + "<?xml version='1.0' encoding='UTF-16'?>"
   XML$ + ""
   XML$ + "<dialogs>"
   XML$ + "  <window flags='#PB_Window_SystemMenu | #PB_Window_TitleBar' text='Preferences' minwidth='520' minheight='400' name='Window_Pref'>"
   XML$ + "    <vbox expand='item:1'>"
   XML$ + "      <scrollarea innerwidth='490' innerheight='550'>"
   XML$ + "        <gridbox columns='3' colexpand='item:3'>"
   XML$ + "          <text text='Used Iconset:' />"
   XML$ + "          <combobox colspan='2' />"
   XML$ + "          <text text='Tree Font:' />"
   XML$ + "          <string colspan='2' />"
   XML$ + "          <editor height='280' colspan='3'/>"
   XML$ + "        </gridbox>"
   XML$ + "      </scrollarea>"
   XML$ + "    </vbox>"
   XML$ + "  </window>"
   XML$ + "</dialogs><!--DDesign0R Definition: PureBasic|1|1-->"

   ProcedureReturn XML$
EndProcedure

;Test it
CompilerIf #PB_Compiler_IsMainFile
   a$ = GetXMLString()
   If CatchXML(0, @a$, StringByteLength(a$), 0, #PB_Unicode)
      CreateDialog(0)
      OpenXMLDialog(0, 0, "Window_Pref")
      RefreshDialog(0)
      Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
   EndIf
CompilerEndIf


Image

_________________
Link dead?
Change h3x0r.ath.cx into hex0rs.coderbu.de and all will be fine.


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog vs. scrollarea
PostPosted: Mon Jan 27, 2020 4:02 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1238
Location: right here
Same result here (Ubuntu 18.04 x64). Works fine with gtk2/qt.
<edit>
no black window with scroll area smaller than window as well.


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog vs. scrollarea
PostPosted: Mon Jan 27, 2020 4:12 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2482
Location: Germany
Is a problem with the ScrollAreaGadget and the GTK3 style. The gadget has no background you can assign a color to.

Have already tried some things. Adding a Linux box or viewport. Nothing worked.

Only to pack everything into a ContainerGadget with frame (Flat, etc) is possible.

P.S.
SetGadgetColor for gtk3 project... viewtopic.php?f=15&t=71992

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog vs. scrollarea
PostPosted: Mon Jan 27, 2020 8:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Sep 20, 2004 7:12 am
Posts: 568
Location: Hell
mk-soft wrote:
Only to pack everything into a ContainerGadget with frame (Flat, etc) is possible.

What exactly does that mean?
I first thought you mean, pack anything into a (flat) container, and put this container inside a scrollarea, I would be fine with that solution also, but unfortunately it doesn't change anything.
You meant, stay away from the scrollarea and use a container instead?
Well, this is unfortunately no option, my preference dialoge would get incredible high...

_________________
Link dead?
Change h3x0r.ath.cx into hex0rs.coderbu.de and all will be fine.


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog vs. scrollarea
PostPosted: Mon Jan 27, 2020 9:56 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2482
Location: Germany
I don' t know how to this with XML
Code:
Procedure BindScrollDatas()
  SetWindowTitle(0, "ScrollAreaGadget " +
                    "(" +
                    GetGadgetAttribute(0, #PB_ScrollArea_X) +
                    "," +                     
                    GetGadgetAttribute(0, #PB_ScrollArea_Y) +
                    ")" )
EndProcedure

If OpenWindow(0, 0, 0, 405, 240, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ScrollAreaGadget(0, 10, 10, 390,220, 575, 555, 30)
  ContainerGadget(5, 0, 0,
                  GetGadgetAttribute(0, #PB_ScrollArea_InnerWidth),
                  GetGadgetAttribute(0, #PB_ScrollArea_InnerHeight),
                  #PB_Container_Flat)
  SetGadgetColor(5, #PB_Gadget_BackColor, $F0F0F0)
  ButtonGadget  (1, 10, 10, 230, 30,"Button 1")
  ButtonGadget  (2, 50, 50, 230, 30,"Button 2")
  ButtonGadget  (3, 90, 90, 230, 30,"Button 3")
  TextGadget    (4,130,130, 230, 20,"This is the content of a ScrollAreaGadget!",#PB_Text_Right)
  CloseGadgetList()
  CloseGadgetList()
  BindGadgetEvent(0, @ BindScrollDatas())
 
  Repeat
    Select WaitWindowEvent()
      Case  #PB_Event_CloseWindow
        Break
      Case  #PB_Event_Gadget
       
    EndSelect
  ForEver
EndIf

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog vs. scrollarea
PostPosted: Mon Jan 27, 2020 10:14 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Sep 20, 2004 7:12 am
Posts: 568
Location: Hell
Ah o.k., you need to color the container, that's the trick.
Thanks!

It's even easier in XML:
Code:
Procedure.s GetXMLString()
   Protected XML$

   XML$ + "<?xml version='1.0' encoding='UTF-16'?>"
   XML$ + ""
   XML$ + "<dialogs>"
   XML$ + "  <window flags='#PB_Window_SystemMenu | #PB_Window_TitleBar' text='Preferences' minwidth='520' minheight='400' name='Window_Pref'>"
   XML$ + "    <vbox expand='item:1'>"
   XML$ + "      <scrollarea innerwidth='490' innerheight='550'>"
   XML$ + "       <container flags='#PB_Container_Flat' name='bla' >"
   XML$ + "        <gridbox columns='3' colexpand='item:3'>"
   XML$ + "          <text text='Used Iconset:' />"
   XML$ + "          <combobox colspan='2' />"
   XML$ + "          <text text='Tree Font:' />"
   XML$ + "          <string colspan='2' />"
   XML$ + "          <editor height='280' colspan='3'/>"
   XML$ + "        </gridbox>"
   XML$ + "       </container>"
   XML$ + "      </scrollarea>"
   XML$ + "    </vbox>"
   XML$ + "  </window>"
   XML$ + "</dialogs><!--DDesign0R Definition: PureBasic|1|1-->"

   ProcedureReturn XML$
EndProcedure

;Test it
CompilerIf #PB_Compiler_IsMainFile
   a$ = GetXMLString()
   If CatchXML(0, @a$, StringByteLength(a$), 0, #PB_Unicode)
      CreateDialog(0)
      OpenXMLDialog(0, 0, "Window_Pref")
      SetGadgetColor(DialogGadget(0, "bla"), #PB_Gadget_BackColor, $F0F0F0)
      RefreshDialog(0)
      Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
   EndIf
CompilerEndIf

_________________
Link dead?
Change h3x0r.ath.cx into hex0rs.coderbu.de and all will be fine.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye